package com.duan.goods.controller;

import com.duan.entity.Result;
import com.duan.goods.pojo.Detail;
import com.duan.goods.service.DetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 查询商品详情
 */
@RestController
@RequestMapping("/detail")
public class DetailController {
    @Autowired
    private DetailService detailService;

    /**
     * 查询商品详情页
     * * @param id
     * * @return
     */
    @GetMapping("/findDetail")
    public Result findDetail(@RequestParam Long id) {
        Detail detail = detailService.findDetail(id);
        return Result.ok("查询成功", detail);
    }
}